<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	>

<h:head>
<title> valider films </title>
<link rel="stylesheet" type="text/css" href="${facesContext.externalContext.requestContextPath}/resource/css/Style.css" /> 
</h:head>

<h:body>
<ui:include src="/entete.xhtml" />
   	
  <p:dataTable var="film" value="#{beansFilm.filmInvalide}">
    <p:column headerText="Id">
        <h:outputText value="#{film.code_film}" />
    </p:column>
 
    <p:column headerText="Titre ">
        <h:outputText value="#{film.titre}" />
    </p:column>
 
    <p:column headerText="Annee de sortie">
        <h:outputText value="#{film.annee_sortie}" >
        	<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
        </h:outputText>
    </p:column>
 
    <p:column headerText="Cout">
        <h:outputText value="#{film.cout}" />
    </p:column>
    
    <p:column headerText="Genre">
        <h:outputText value="#{film.genre}" />
    </p:column>
    
    <p:column headerText="Date de creation">
        <h:outputText value="#{film.date_creation}" >
        	<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
        </h:outputText>
    </p:column>
    
    <p:column headerText="Action">
    <h:form>
         <p:commandButton value="valider" action="#{beansFilm.validerFilm}" ajax="false" >
         	<f:setPropertyActionListener value="#{film}" target="#{beansFilm.film}" />
         </p:commandButton>
		 <p:commandButton value="supprimer" action="#{beansFilm.supprimerFilm}" ajax="false" >
		 	<f:setPropertyActionListener value="#{film}" target="#{beansFilm.film}" />
		 </p:commandButton>
	</h:form>
    </p:column>
    
</p:dataTable>


<ui:include src="/Pied.xhtml"/>
</h:body>

</html>